import React, { Component } from "react";
import "./index.css";
import Item from "../Item";
export default class List extends Component {
  render() {
    const { todos } = this.props;
    return (
      <div>
        <ul className="todo-main">
          {todos.map((item) => {
            return (
              <Item
                key={item.id}
                item={item}
                updateTodo={this.props.updateTodo}
                deleteTodo={this.props.deleteTodo}
              />
            );
          })}
        </ul>
      </div>
    );
  }
}
